package com.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mapper.PubMapper;
import com.example.pojo.Pub;
import com.example.service.PubService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PubServiceImpl extends ServiceImpl<PubMapper, Pub> implements PubService {
    @Autowired
    private PubMapper pubMapper;

    @Override
    public List<Pub> selectAllPub(String brand, Integer start, Integer pageSize) {
        return pubMapper.selectAllPub(brand, start, pageSize);
    }

    @Override
    public int count(String brand) {
        return pubMapper.count(brand);
    }

    @Override
    public int deletePub(Integer id) {
        return pubMapper.deleteById(id);
    }

    @Override
    public Pub selectPubById(Integer id) {
        return pubMapper.getPubById(id);
    }

    @Override
    public int updatePub(Pub pub) {
        return pubMapper.updatePub(pub);
    }

    @Override
    public int updatePub2(Pub pub) {
        return pubMapper.updatePub2(pub);
    }
}
